import { api } from './apiClient';
import type { GrammarCheckResult } from '../types/grammar';

export async function checkGrammar(text: string): Promise<GrammarCheckResult> {
  const res = await api.post<{ success: boolean; data: GrammarCheckResult }>('/grammar/check', { text });
  return res.data.data;
}